package com.weixin.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import com.weixin.dao.Role_TbDAO;
import com.weixin.entity.Role_Tb;
import com.weixin.util.C3p0Util;

public class Role_TbDAOImpl implements Role_TbDAO {

	@Override
	public List<Role_Tb> selectAll() throws SQLException {
		// TODO Auto-generated method stub
		String sql="select * from role_tb";
		return C3p0Util.qr.query(sql, new BeanListHandler<Role_Tb>(Role_Tb.class));
	}

	@Override
	public int selectByTitle(String title) throws SQLException {
		// TODO Auto-generated method stub
		String sql="select * from role_tb where title=?";
		return (int)C3p0Util.qr.query(sql, new ScalarHandler(),title);
		
	}

	@Override
	public Role_Tb getByName(String name) throws SQLException {
		// TODO Auto-generated method stub
		String sql="select * from role_tb where title=?";
		return null;
	}



	

	
}
